<?php 


     $title         =$this->formText('title',$this->result['0']['title'],array('class'=>'txttextbox'));
     $published 	=$this->formRadio('published',$this->result['0']['published'],null,array('0'=>'No','1'=>'Yes'), ' ');
     $featured 		=$this->formRadio('featured',$this->result['0']['featured'],null,array('0'=>'No','1'=>'Yes'), ' ');
     $special 		=$this->formRadio('special',$this->result['0']['special'],null,array('0'=>'No','1'=>'Yes'), ' ');
     $order         =$this->formText('order',$this->result['0']['order'],array('class'=>'txttextbox'));
     
     $sec           =$this->seclist;
     $sec['0']      ='Chọn thể loại tin';
     ksort($sec);
     $sec_id 		=$this->formSelect('section_id',$this->result['0']['section_id'],array('class'=>'txttextbox'),$sec,' ');
     $images		=$this->formText('images',$this->result['0']['images'],array('class'=>'txttextbox'));
 
     $cat           =$this->catlist;
     $cat['0']      ='Chọn loại tin';
     ksort($cat);
     $cat_id 		=$this->formSelect('cat_sub',$this->result['0']['cat_id'],array('class'=>'txttextbox'),$cat,' ');
     
     $language    =$this->language;
     $language['0']='Select Language';
     ksort($language);
     $select_language =$this->formSelect('language_id',$this->result['0']['language_id'],array('class'=>'cbo_box'),$language,'');

 ?>
<script type="text/javascript">
	$(document).ready(function(){
	        $("#section_id").change( function() {
	        	val = $(this).val();
	        	$("#category").load('<?php echo JURI; ?>/index/getcat/id/' + val);
	        });
	});
</script>

<div>
<form name="appForm" method="post" action="" id="appForm">
<?php echo $this->render('/news/include/toolbar.php');?>
<?php 
     if (empty($this->error)==false)
         {
           echo '<h2 class="error">'.$this->error.'</h2>'	;
         }
  ?>
  <table class="tbl_content" width="99%" cellspacing="0" cellpadding="4" border="0">
  
     <tr>
        <td class="left_lable">Titile</td>
        <td class="right_lable"><?php echo $title;?></td>
     </tr>
      <tr>
         <td class="left_lable">Language</td>
         <td class="right_lable"><?php echo $select_language; ?></td>
     </tr>
     <tr>
        <td class="left_lable">Section</td>
        <td class="right_lable"><?php echo $sec_id;?></td>
     </tr>
      <tr id="category" >
         <td class="left_lable">Category</td>
         <td class="right_lable"><?php echo $cat_id;?></td>
     </tr>
     
      <tr>
        <td class="left_lable">Introtext</td>
        <td class="right_lable">
              <textarea name=introtext id=introtext class=txttextbox /><?php echo $this->result['0']['introtext']; ?></textarea>
					<script type="text/javascript">
					             var editor = CKEDITOR.replace( 'introtext',{
					            uiColor : '#9AB8F3',
					            language:'vi',
					            skin:'kama',
					            width:'98%',
					            height:'350',
					            filebrowserImageBrowseUrl : '<?php echo JURI."ckfinder/ckfinder.html?Type=Images";?>',
					            filebrowserFlashBrowseUrl : '<?php echo JURI."ckfinder/ckfinder.html?Type=Flash";?>',
								filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
								filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
								 	
					            toolbar:[
					            ['Source','-','Save','NewPage','Preview','-','Templates'],
					            ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
					            ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
					            ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
					            ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
					            ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
					            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
					            ['Link','Unlink','Anchor'],
					            ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
					            ['Styles','Format','Font','FontSize'],
					            ['TextColor','BGColor'],
					            ['Maximize', 'ShowBlocks','-','About']
					            ]
					          });		
                     </script>
       </td>
       
     </tr>
     <tr>
        <td class="left_lable">Images</td>
        <td class="right_lable">
         <?php echo $images; ?>
         <input onclick="BrowseServer('Images:/','images')" type="button" name="btnchonfile" id="btnchonfile" value="Browse" />
       </td>
     </tr>
      <tr>
        <td class="left_lable">Fulltext</td>
        <td class="right_lable">
               <textarea name="fulltext" id="fulltext" class="fulltext" /><?php echo $this->result['0']['fulltext']; ?></textarea>
						<script type="text/javascript">
					             var editor = CKEDITOR.replace('fulltext',{
					            uiColor : '#9AB8F3',
					            language:'vi',
					            skin:'kama',
					            width:'98%',
					            height:'350',
					            filebrowserImageBrowseUrl : '<?php echo JURI."ckfinder/ckfinder.html?Type=Images";?>',
					            filebrowserFlashBrowseUrl : '<?php echo JURI."ckfinder/ckfinder.html?Type=Flash";?>',
								filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
								filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
								 	
					            toolbar:[
					            ['Source','-','Save','NewPage','Preview','-','Templates'],
					            ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
					            ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
					            ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
					            ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
					            ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
					            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
					            ['Link','Unlink','Anchor'],
					            ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
					            ['Styles','Format','Font','FontSize'],
					            ['TextColor','BGColor'],
					            ['Maximize', 'ShowBlocks','-','About']
					            ]
					            });		
			          </script>
       </td>
       
     </tr>
     <tr>
        <td class="left_lable">Published</td>
        <td class="right_lable"><?php echo $published;?></td>
     </tr>  
     <tr>
        <td class="left_lable">Order</td>
        <td class="right_lable"><?php echo $order; ?></td>
      </tr>
      <tr>
        <td class="left_lable">Features</td>
        <td class="right_lable"><?php echo $featured;?></td>
     </tr>  
     <tr>
        <td class="left_lable">Special</td>
        <td class="right_lable"><?php echo $special;?></td>
     </tr>  
    
  </table>
  <input type="hidden" name="key" id="id" value="edit">

</form>
</div>